//
//  XMSNav.m
//  XMSimonUtils_Example
//
//  Created by 徐盟 on 2023/3/17.
//  Copyright © 2023 xumeng. All rights reserved.
//

#import "XMSNav.h"


@implementation XMSNav
- (instancetype) initWithDict:(NSDictionary *) dict
{
    if(self = [super init]){
        // self.answer =  dict[@"answer"];
        [self setValuesForKeysWithDictionary:dict];
    }
    
    return self;
}
+(instancetype) selfWithDict:(NSDictionary *) dict
{
    XMSNav * nav = [[self alloc] initWithDict:dict];

    Class Clazz = NSClassFromString(nav.controller);

    if (Clazz != nil && [Clazz respondsToSelector:@selector(getNavItems)]) {

        nav.items =  [Clazz getNavItems];
    }
    
    return  nav;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}
@end
